Skip to content

Fix Path.as_uri on Python 3.14 - #3460

Merged
jakkdl merged 2 commits into
python-trio:mainfrom
nyxst4ck:codex/fix-path-as-uri-py314
Jul 29, 2026
Merged

Fix Path.as_uri on Python 3.14#3460
jakkdl merged 2 commits into
python-trio:mainfrom
nyxst4ck:codex/fix-path-as-uri-py314

Conversation

@nyxst4ck

Copy link
Copy Markdown
Contributor

Summary

  • route trio.Path.as_uri() through the concrete wrapped pathlib.Path class
  • remove the Python 3.14 xfail now that the method no longer calls the deprecated PurePath.as_uri() path

Tests

  • uv run pytest src/trio/_tests/test_path.py -q
  • git diff --check

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00000%. Comparing base (05c8efa) to head (f1b2505).

Additional details and impacted files
@@               Coverage Diff               @@
##                 main        #3460   +/-   ##
===============================================
  Coverage   100.00000%   100.00000%           
===============================================
  Files             128          128           
  Lines           19417        19419    +2     
  Branches         1317         1317           
===============================================
+ Hits            19417        19419    +2     
Files with missing lines Coverage Δ
src/trio/_path.py 100.00000% <100.00000%> (ø)
src/trio/_tests/test_path.py 100.00000% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@A5rocks A5rocks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is fine. For future contributions to Trio, please don't write PR text/comments with an LLM!

Comment thread src/trio/_path.py
if sys.version_info >= (3, 13):
full_match = _wrap_method(pathlib.Path.full_match)

# TODO: only allow this for Python <3.19.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.19 🤭

@jakkdl
jakkdl merged commit 1858c7f into python-trio:main Jul 29, 2026
44 checks passed
@trio-bot

trio-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

Hey @nyxst4ck, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂

If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:

  • Github will automatically subscribe you to notifications on all our repositories. (But you can unsubscribe again if you don't want the spam.)

  • You'll be able to help us manage issues (add labels, close them, etc.)

  • You'll be able to review and merge other people's pull requests

  • You'll get a [member] badge next to your name when participating in the Trio repos, and you'll have the option of adding your name to our member's page and putting our icon on your Github profile (details)

If you want to read more, here's the relevant section in our contributing guide.

Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you.

If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants